package com.gaswell.canal;

import com.gaswell.canal.chain.PoliceHandler;
import com.gaswell.mapper.AlarmRecordMapper;
import com.gaswell.pojo.AlarmRecord;
import com.gaswell.pojo.Diagnosis;
import com.gaswell.pojo.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import top.javatool.canal.client.annotation.CanalTable;
import top.javatool.canal.client.handler.EntryHandler;

@Slf4j
@Component
@CanalTable(value = "diagnosis")
public class DiagnosisHandler implements EntryHandler<Diagnosis> {
    @Autowired
    BeanFactory beanFactory;
    @Autowired
    AlarmRecordMapper alarmRecordMapper;

    @Autowired
    PoliceHandler policeHandler;

    @Override
    public void insert(Diagnosis diagnosis) {
        policeHandler.handleRequest(diagnosis);
    }

    @Override
    public void update(Diagnosis before, Diagnosis after) {
        policeHandler.handleRequest(after);
    }

    @Override
    public void delete(Diagnosis diagnosis) {
//        policeHandler.handleRequest(diagnosis);
    }
}
